package com.cmdi.config;

import io.minio.MinioClient;
import io.minio.errors.InvalidEndpointException;
import io.minio.errors.InvalidPortException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: java类作用描述
 * @Author: gaozb
 * @Date: 2021/9/17$ 14:51$
 * @Version: 1.0
 */
@Configuration
public class MinioClientConfig {
    @Value("${file.store.minio.endpoint:http://localhost:9001}")
    private String endPoint;
    @Value("${file.store.minio.accesskey:aaaa}")
    private String accessKey;
    @Value("${file.store.minio.secretkey:bbbb}")
    private String secretKey;

    @Bean
    public MinioClient minioClient() throws InvalidPortException, InvalidEndpointException {
        return new MinioClient(endPoint, accessKey, secretKey);
    }
}